"""
@name : statistics_word
@author : maxueyan
@projectname: sanchuang
"""

import collections
import re
with open("Walden.txt","r",encoding="utf-8") as file1:
    one = file1.read()
    file2 = one.lower()
    file3 = re.sub(r'["\d+",\n/?+:.;!$-]', ' ', file2)
    data = file3.split()
s = collections.Counter(data)
s_list = s.most_common()
for i in s_list:
    print("word:{}   time:{}".format(i[0].rstrip(), i[1]))